package pattern.principle.ocp;

import java.util.ArrayList;

public class BookStore {

	private ArrayList<IBook> bookList = new ArrayList<IBook>();
	
	public BookStore(){
		//bookList.add(new NovelBook("西游记", 79.20, "吴承恩"));
		bookList.add(new OffNovelBook("西游记", 79.20, "吴承恩"));
	}
	
	public void showBooks(){
		for(IBook book:bookList){
			System.out.println(book.getName()+" "+book.getPrice());
		}
	}
	public static void main(String[] args) {
		BookStore book = new BookStore();
		book.showBooks();
	}
}
